package com.wenge.datagroup.storage.dataprocess;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @description
 * @Projectname: centrecollect_temp
 * @Author: lzh
 * @Data:2022/10/20 20:13
 * @Description: TODO
 */
public class EmojiFilter {
    static Pattern emoji = Pattern.compile("[\ud83c\udc00-\ud83c\udfff]|[\ud83d\udc00-\ud83d\udfff]|[\u2600-\u27ff]",
            Pattern.UNICODE_CASE | Pattern.CASE_INSENSITIVE);
    public static String filter(String source){
        if (source != null) {;
            Matcher emojiMatcher = emoji.matcher(source);
            if (emojiMatcher.find()) {
                source = emojiMatcher.replaceAll("");
                return source;
            }
            return source;
        }

        return source;

    }
}
